package com.util;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropUtil {
    static Logger logger = LogManager.getLogger(PropUtil.class);
    public static Properties getConfig(String file){
        Properties pro = new Properties();
        InputStream in = null;
        try {
            in = PropUtil.class.getClassLoader().getResourceAsStream(file);
            pro.load(in);
        }catch (IOException e){
            logger.error(e.toString());
        }
        try {
            in.close();
        }catch (IOException e){
            e.printStackTrace();
        }
        return pro;
    }
}
